﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

class UpgradeTowerCommand : Controller
{
    public override void Execute(object data)
    {
        if (GetModel<GameModel>().Gold < 100)
        {
            Debug.Log("升级钱不够");
            return;
        }
        //升级扣钱
        GetModel<GameModel>().Gold -= 100;
        UpgradeTowerArgs e = data as UpgradeTowerArgs;
        Tower tower = e.tower;
        tower.Level++;
    }
}